home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text;
-
- import com.sun.java.swing.event.CaretEvent;
- import com.sun.java.swing.event.ChangeEvent;
- import com.sun.java.swing.event.ChangeListener;
- import java.awt.event.FocusEvent;
- import java.awt.event.FocusListener;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.util.EventObject;
-
- class JTextComponent$MutableCaretEvent extends CaretEvent implements ChangeListener, MouseListener, FocusListener {
- private boolean dragActive;
- private int dot;
- private int mark;
-
- JTextComponent$MutableCaretEvent(JTextComponent c) {
- super(c);
- }
-
- final void fire() {
- JTextComponent c = (JTextComponent)((EventObject)this).getSource();
- if (c != null) {
- Caret caret = c.getCaret();
- this.dot = caret.getDot();
- this.mark = caret.getMark();
- c.fireCaretUpdate(this);
- }
-
- }
-
- public final String toString() {
- return "dot=" + this.dot + "," + "mark=" + this.mark;
- }
-
- public final int getDot() {
- return this.dot;
- }
-
- public final int getMark() {
- return this.mark;
- }
-
- public final void stateChanged(ChangeEvent e) {
- if (!this.dragActive) {
- this.fire();
- }
-
- }
-
- public void focusGained(FocusEvent e) {
- JTextComponent.access$focusedComponent((JTextComponent)((EventObject)this).getSource());
- }
-
- public void focusLost(FocusEvent e) {
- }
-
- public final void mousePressed(MouseEvent e) {
- this.dragActive = true;
- }
-
- public final void mouseReleased(MouseEvent e) {
- this.dragActive = false;
- this.fire();
- }
-
- public final void mouseClicked(MouseEvent e) {
- }
-
- public final void mouseEntered(MouseEvent e) {
- }
-
- public final void mouseExited(MouseEvent e) {
- }
- }
-